<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>二手商品交易平台| {% block title %}{% endblock %}</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <!-- Le styles -->
  <link href="/css/bootstrap.min.css" rel="stylesheet">
  {% block header %}

  {% endblock %}
  <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

  <style>
    .img_box{
      display: block;
      overflow: hidden;
      position: relative;
      width: 260px;
      height: 260px;
      background: white;

    }
    .img{
      position: absolute;
      top: 50%;
      left:50%;
      transform: translate(-50%,-50%);
    }
  </style>

</head>

<body>

  <div class="navbar">
    <div class="navbar-inner">
      <div class="container">
        <a class="brand" href="\">二手商品交易平台</a>
        <div class="nav-collapse pull-right">
          <!-- <form class="navbar-search" action="#">
            <input type="text" class="input-small" placeholder="Username">
            <input type="password" class="input-small" placeholder="Password" autoComplete="current-password">
          </form> -->
          <ul class="nav">
            {% if session.is_login %}
            <li><a href="\my\">欢迎您，{{session.username}}</a></li>
            <li class="divider-vertical"></li>
            <li><a href="\my\">我的功能</a></li>
            <li><a href="\logout\">退出</a></li>
            {% else %}
            <li><a href="\login\">登陆</a></li>
            <li><a href="\register\">注册</a></li>
            {% endif %}



          </ul>
        </div>

      </div>
    </div>
  </div>


  {% block content %}

  {% endblock %}



  <script src="/js/jquery-1.7.2.min.js"></script>
  <script src="/js/bootstrap-alert.js"></script>
  <!-- <script src="/js/bootstrap-modal.js"></script> -->
  <script>
    function getRandomString(len) {
      let _charStr = 'abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789',
        min = 0,
        max = _charStr.length - 1,
        _str = '';                    //定义随机字符串 变量
      //判断是否指定长度，否则默认长度为15
      len = len || 15;
      //循环生成字符串
      for (var i = 0, index; i < len; i++) {
        index = (function (randomIndexFunc, i) {
          return randomIndexFunc(min, max, i, randomIndexFunc);
        })(function (min, max, i, _self) {
          let indexTemp = Math.floor(Math.random() * (max - min + 1) + min),
            numStart = _charStr.length - 10;
          if (i == 0 && indexTemp >= numStart) {
            indexTemp = _self(min, max, i, _self);
          }
          return indexTemp;
        }, i);
        _str += _charStr[index];
      }
      return _str;
    }
    if (!document.cookie) {
      document.cookie = getRandomString(20)
    }
  </script>
  {% block js %}


  {% endblock %}
</body>

</html>